package cn.uniquesoft.vo;

/**
 * @author zyx
 * @date 2017年6月22日 下午5:26:24
 * @description 前端请求后端响应
 */
public class AnswerVO {
    // 是否成功
    private boolean success = false;
    // 提示语
    private String msg = "";
    // 返回的数据
    private Object data;
    private UserVO user;
    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static AnswerVO success(String msg) {
        AnswerVO item = new AnswerVO();
        item.setData("");
        item.setMsg(msg);
        item.setSuccess(true);
        return item;
    }

    public static AnswerVO error(String msg) {
        AnswerVO item = new AnswerVO();
        item.setData("");
        item.setMsg(msg);
        item.setSuccess(false);
        return item;
    }

    public UserVO getUser() {
        return user;
    }

    public void setUser(UserVO user) {
        this.user = user;
    }
}
